<template>
  <el-container>
    <el-main>
      <el-form label-width="50px" class="demo-ruleForm">
        <h3>后台管理系统</h3>
        <el-form-item label="账号">
          <el-input type="text" v-model="username"></el-input>
        </el-form-item>
        <el-form-item label="密码">
          <el-input type="password" v-model="password"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="login">登录</el-button>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      username: "",
      password: "",
    };
  },
  methods: {
    login() {
      // if (this.username === "admin" && this.password === "admin") {
      //   this.$router.push("/index");
      // } else {
      //   alert("账号或密码错误");
      // }
      this.$router.push("./index/homePage");
    },
  },
};
</script>
<style lang="less" scoped>
.el-main {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: #13152d;
}
.demo-ruleForm {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 450px;
  height: 300px;
  margin: auto;
  background-color: #0f2a4c;
  h3 {
    padding-top: 10px;
    text-align: center;
    color: rgb(95, 184, 232);
  }
  .el-form-item {
    width: 80%;
    margin: 30px auto;
  }
  .el-button {
    margin: auto;
    width: 100%;
  }
}
</style>